package com.cc.bsp.persistence;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import com.cc.bsp.persistence.entity.IEntity;
import com.cc.bsp.persistence.exception.PersistenceException;

public interface IEntityDao<T extends IEntity,ID extends Serializable> {
	
	void save(final T entity) throws PersistenceException;
	
	void update(final T entity) throws PersistenceException;
	
	void deleteById(final ID id) throws PersistenceException;
	
	void delete(final T entity) throws PersistenceException;

	void deleteBatch(final List<T> list) throws PersistenceException;

	void add(final T entity) throws PersistenceException;

	void addBatch(final List<T> list) throws PersistenceException;
	
	T findById(final ID id) throws PersistenceException;

	T findUniqueBy(final String propertyName, final Object propertyValue)throws PersistenceException;
	
	List<T> get(final Collection<ID> ids)throws PersistenceException;
	
	List<T> get(final Collection<ID> ids,final IQueryPageOrder pageorder)throws PersistenceException;
	
	List<T> findList(final String propertyName, final Object propertyValue)throws PersistenceException;
	
	List<T> findList(final String propertyName, final Object propertyValue,final IQueryPageOrder pageorder)throws PersistenceException;
	
	List<T> findList(final T entity) throws PersistenceException;
	
	List<T> findList(final T entity,final IQueryPageOrder pageorder) throws PersistenceException;
	
	List<T> findAll() throws PersistenceException;
	
	List<T> findAll(final IQueryPageOrder pageorder)  throws PersistenceException;

}
